package com.java.tutorials.jdk7.directorystream;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
/**
 * Created by xuzhike on 2016/1/23.
 * http://www.java2s.com/Code/Java/JDK-7/GetDirectoryStreamfromaPathwithfilenamematcher.htm
 * Get DirectoryStream from a Path with file name matcher
 */
public class DirectoryStreamfromaPathwithfilenamematcherTest {
    public static void main(String[] args) throws Exception{

        Path dir = Paths.get("E:\\OpenSources\\MyProjects\\javaTutorials\\src\\main\\java\\com\\java\\tutorials\\jdk7\\directorystream");

        DirectoryStream<Path> stream = Files.newDirectoryStream(dir,"*.java");
        for (Path entry : stream) {
            System.out.println(entry.getFileName());
        }
    }
}
